home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Directorty Opus 5 - Magellan 2
/
Opus 5 - Magellan 2.iso
/
Extras
/
CompareDirs
/
CompareDirs.rexx
Wrap
OS/2 REXX Batch file
|
1996-06-22
|
1KB
|
64 lines
/*
** CompareWindows.rexx
**
** written by Miloslaw Smyk <smykm@felix.univ.szczecin.pl>
**
** $VER 1.02
**
** This command is similar to Norton Commander's "Compare Directories"
** and can be invoked by a hot-key in Directory Opus.
**
** Different entries will be selected in active window, all the other
** will become deselected. Final message (on title bar) shows:
** number_different_entries / total_entries_in_window
**
** © 1994 W.F.M.H.
*/
OPTIONS RESULTS
NL = '0A'X
DOPUSToFront
Status 3 /* get number of the active window */
ActWin=result
DctWin=1-ActWin
GetAll '"/"' ActWin
window1 ="/" || UPPER(RESULT) || "/"
GetAll '"/"' DctWin
window2="/" || UPPER(RESULT) || "/"
WordStart = 1
WordEnd = 2
idx = 0
diff = 0
Status 6 ActWin /* how many files in the active window */
iter = RESULT
TopText 'Comparing windows...'
DO iter
WordEnd=POS('/', window1, WordEnd);
name = SUBSTR(window1, WordStart, WordEnd-WordStart+1)
IF index(window2, name) = 0 THEN
DO
SelectEntry idx 1
diff=diff+1
END
ELSE
SelectEntry idx 0
WordStart=WordEnd
WordEnd=WordEnd+1
idx=idx+1
END
TopText diff || '/' || idx || ' different entries.'
DisplayDir ActWin